<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix ="s" uri="/struts-tags"%>
<%@taglib uri="estateTag" prefix="estateTag" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    <title>商家信息</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" href="../resource/css/global.css" type="text/css"></link>
	<link rel="stylesheet" type="text/css" href="<%= basePath %>resource/css/easyui/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%= basePath %>resource/css/easyui/icon.css">
	<script type="text/javascript" src="<%= basePath %>resource/js/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="<%= basePath %>resource/js/easyui/jquery.easyui.min.js"></script>
	<script type="text/javascript"	src="<%= basePath %>resource/js/easyui/easyui-lang-zh_CN.js"></script>
		<link rel="stylesheet" type="text/css" href="<%= basePath %>resource/js/kindeditor/skins/default.css"></link>
			<script type="text/javascript" src="<%= basePath %>resource/js/kindeditor/kindeditor.js"></script>
	<link rel="stylesheet" href="<%= basePath %>resource/css/whole.css" type="text/css"></link>
	<link rel="stylesheet" href="<%= basePath %>resource/css/global.css" type="text/css"></link>
	    <link rel="stylesheet" href="<%= basePath %>resource/css/memberCenter/info.css" type="text/css"></link>
	    		<link rel="stylesheet" href="../resource/css/memberCenter/infowithoutmenu.css"
			type="text/css"></link>
	  <style type="text/css">
		.info_top{
			background-position: 0 0;
		}
	</style>
  </head>
  <script type="text/javascript">
    var  a=0;
    function checkImage(obj) {
	if (/(.gif)|(.png)|(.jpg)|(.jpeg)|(.ico)$/.exec(obj.value))
		return true;
	else
		return false;
  }
// 为true不等于空
function checkNull(obj) {
	if (obj.value.trim().length == 0)
		return false;
	else
		return true;
 }
   function  checkSave()
   { 
       
             var  name= $("#name").val();
             if(""==name){
                  alert("请填写品牌名");
                   $("#name").focus();
                  return false;
               }
               var  brandid=document.getElementById("brandid").value;
               if(brandid==""){
               var  img=document.getElementById("imglog");
               
               if (img.value!=undefined) {
			       if (!checkImage(img)) {
			         alert('品牌log图片上传格式不正确，应为 gif、png、jpg、jpeg、ico格式');
			       img.focus();
			      return false;
		         }
		      }
           var  imgpic=document.getElementById("imgpic");
            if (imgpic.value!=undefined) {
			    if (!checkImage(imgpic)) {
			    alert('商家图片上传格式不正确，应为 gif、png、jpg、jpeg、ico格式');
			    imgpic.focus();
			   return false;
		      }
		   }
		   
		    }
		    
              /**var  username= $("#username").val();
              if(""== username){
                  alert("请填写商家登入名");
                 $("#username").focus();
                  return  false;
              }else{
                      if(brandid==""){
                     checkloginuserName(username);
                     }else{
                     var oldusername=document.getElementById("oldusername").value;
                     checkloginReuserName(username,oldusername);
                     }
                    if(a==1){
                      return false;
                    };
                
              }**/
             /** var  password= $("#password").val();
              if(""== password){
                  alert("请填写商家登入密码");
                   $("#password").focus();
                  return  false;
              }**/
           /**   var  companyName= $("#companyName").val();
              if(""== companyName){
                  alert("请填写公司名称");
                  $("#companyName").focus();
                  return  false;
              }
               var  shopAddress= $("#shopAddress").val();
              if(""== shopAddress){
                  alert("请填写公司地址");
                  $("#shopAddress").focus();
                  return  false;
              }
             
               var  phone= $("#phone").val();
              if(""== phone){
                  alert("请填写公司电话");
                  $("#phone").focus();
                  return false ;
              }
           var  companyOPerer= $("#companyOPerer").val();
              if(""== companyOPerer){
                  alert("请填写负责人");
                  $("#companyOPerer").focus();
                  return false;
              }**/
              var  statement= $("#statement").val();
		  
					 if(""==statement){
					    alert("请填写商家声明");
					    $("#statement").focus();
					    return false;
					 }
					 if($("#statement").val().length>200)
					 {  
					      alert("商家声明输入已超过200个字");
	                     $("#statement").focus();
	                     return false;
					 }
					 
    }  

	   
	 
  </script>
  <body onload="information()"><estateTag:security></estateTag:security>
  	<center><jsp:include page="../index/top.jsp"></jsp:include></center>
   <div style="width: 100%;margin-top: 10px;" align="center">
   <input id="menuCls" type="hidden" value="331">
			<table width="100%" class="layoutTab">
				<tr> 
					<!-- <td width="20%" align="left" valign="top"><jsp:include page="../menu.jsp"></jsp:include></td> -->
						<td valign="top" align="center">
									<form name="form" method="post"
										action="../brand/addSaveShoper.shtml" enctype="multipart/form-data" 
										onsubmit="return checkSave()">
					 <div class="position" align="left"><label>您所在的位置：</label>商家后台管理&nbsp;&nbsp;--&gt;&gt;&nbsp;&nbsp;完善资料</div>
    					<br/>
					<div class="info_top"></div>
					<div class="info_mid" align="center">
										<table width="100%" border="0" cellpadding="1" cellspacing="1">
											<tr>
												<td align="left" colspan="2" style="padding-left: 25px;">
													<img src="<%= basePath %>resource/img/ann_icon.gif">&nbsp;&nbsp;&nbsp;&nbsp;<s:if test='%{#session.brandInfo.auding=="1"}'><font color="green">信息已审核通过。</font></s:if><s:if test='%{#session.brandInfo.auding=="0"}'><font color="red">信息未审核通过，如果疑问请联系管理员。</font></s:if><s:else>请完善以下信息,等待管理员审核！</s:else>
												</td>
											</tr>
											<tr>
												<td align="center" colspan="2">
													<b>商家信息完善 （<font color="red">*</font> 为必填项）</b>
												</td>
											</tr>
										    <tr>
												<td align="right" width="16%">
														<font color="red">*</font>品牌：
 												</td>
												<td align="left">
														<input size="70" type="text" maxlength="50" id="name" name="tgBrand.name" value="${tgBrand.name}">	
												</td>
											</tr>
									<!-- 	<tr>
												<td align="right" width="16%">
													简介标题：
												</td>
												<td align="left">
													<input type="text" maxlength="50" id="accTitle" style="width: 250px"
														name="tgBrand.accTitle" value="${tgBrand.accTitle}">
												</td>
											</tr> -->	
											<tr>
												<td align="right">
													<font color="red">*</font>	品牌log：
												</td>
												<td align="left">
												
												    <s:if test="#request.tgBrand.imgsrc!= null" >
											                   <img src="../${tgBrand.imgsrc}" height="45px" width="144px"/><br/><input size="60" type="file" id="imglog" name="imglog"/>
											          </s:if>
											          <s:else>
											          <input  size="60"  type="file" id="imglog" name="imglog"/>
											          </s:else>
												      <font color="red" >（建议图片大小宽144px,高45px）</font>
												</td>
											</tr>
											<tr>
												<td align="right">
													<font color="red">*</font>	商家图片：
												</td>
												<td align="left">
												  <s:if test="#request.tgBrand.brandPic!= null">
											                   <img src="../${tgBrand.brandPic}" height="140" width="500"/><br/><input size="60" type="file" id="imgpic" name="imgpic"/>
											          </s:if>
											          <s:else>
											         <input type="file" size="60"  name="imgpic" id="imgpic"/>
											          </s:else>
												     	<font color="red" >（建议图片大小宽1000px,高280px）</font>
												</td>
											</tr>
											 
											<tr>
												<td align="right">
														
												</td>
												<td align="left">
												</td>
											</tr>
                                               <tr>
												<td align="right">
														商家声明：
												</td>
												<td align="left" >
														<textarea cols="80" rows="20"  id="statement" name="tgBrand.stateMent">${tgBrand.stateMent}</textarea>
												</td>
											</tr>   
											<tr>
												<td colspan="2" align="center">
													 <input type="hidden" name="tgBrand.auding" value="0">
													  <input type="hidden" id="auding" value="${tgBrand.auding}">
                                                      <input type="hidden" name="tgBrand.id" id="brandid" value="${tgBrand.id}">
													<!-- 审核状态 未审核 -->

													<input type="submit" value="保存">
													&nbsp;
													
												</td>
											</tr>
										</table>
										   </div>
			<div class="info_bottom">&nbsp;</div>
									</form>
								</td>
							</tr>
						</table>
		</div>          <input type="hidden"/>
						<div style="margin-top: 10px;">
		</div>    
  	<center> <iframe src="../index/footer.html" width="970" height="120" frameborder="0" scrolling="no"></iframe> </center></body>
  <script>
            function   information (){
                 var auding=document.getElementById("auding").value;
                 if(auding=="0"){
                   alert("您的商家信息还没有被审核");
                 }
                  if(auding=="2"){
                   alert("您的商家信息审核不通过");
                 }
            }
  
  
	/*		KE.show({
				id : 'content1',
				loadStyleMode : false,
				resizeMode : 0,
				allowUpload:true, //允许上传图片 
				imageUploadJson:'<%=basePath%>/comutil/upload.shtml',    
				items : [
				'fontname', 'fontsize', '|', 'textcolor', 'bgcolor', 'bold', 'italic', 'underline',
				'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
				'insertunorderedlist', '|','image']
			});*/
		function goback()
          {
            history.back();
          }
		</script>
</html>
